using System;
using System.Collections;
using System.Collections.Generic;


	/// <summary>
	/// Summary description for CacheUtil.
	/// </summary>
	public class CacheUtil
	{
		public CacheUtil()
		{
			//
			// TODO: Add constructor logic here
			//
		}
        internal static Dictionary<string, object> dic = new Dictionary<string, object>();
		public static void SetKey(string Key, object Data)
		{
            if (Data != null)
            {
                dic.Add(Key.ToUpper(), Data);
            }
		}

		public static bool IsNull(string Key)
		{
            return (dic.ContainsKey(Key)==false);
		}

		public static object GetData(string Key)
		{
            if (dic.ContainsKey(Key.ToUpper()))
                return dic[Key.ToUpper()];
            else
                return null;
		} 

		public static void RemoveKey(string Key)
		{
            if (dic.ContainsKey(Key.ToUpper()))
			{
                dic.Remove(Key.ToUpper());
			}
		}		

		public static string[] GetAllNames()
		{
            string[] keys = new string[dic.Keys.Count];
            dic.Keys.CopyTo(keys, 0);
            return keys;
		}		
	}
